function test(x:longint;p:pchar):pchar;stdcall; //the function syntax
begin
//the "x" param can be used as a switch:if is equal to 1 do something,if is equal to 2 do something ...
//the "p" param can be used to customize your function;try to replace 'Out of memory' with "p" and call the function from the client with a string param
//put your code here
//example:
messagebox(0,'Out of memory!','Fatal error',MB_OK+MB_ICONERROR); //this will display a message when the function is called
test:='STLmessage displayed'; //the function return value will be displayed in the client